<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
	<f:view>
		<ui:composition template="/template/templatePadrao.xhtml">
			<ui:define name="body">
				<h:outputText value="Clínica > Cadastro" styleClass="breadcrumb"/><br /><br />
				<p:panel header="Cadastro de Clínica">
					<h:form enctype="multipart/form-data">
						<h:panelGrid columns="2">
							
							<h:outputText value="Tipo de Clínica" />
							<p:selectOneRadio value="#{clinicaManager.clinica.tipoClinica}" disabled="true">
								<f:selectItems value="#{utilManager.listTipoClinica}" />
							</p:selectOneRadio>
							
							
							<h:outputText value="Nome da Clínica" />
							<p:inputText value="#{clinicaManager.clinica.nomeClinica}" />
							
							<h:outputText value="Endereço da Clínica" />
							<p:inputText value="#{clinicaManager.clinica.enderecoClinica}" />
							
							<h:outputText value="CNPJ da Clínica" />
							<p:inputMask value="#{clinicaManager.clinica.documentoClinica}" mask="99.999.999/9999-99" disabled="true"/>
							
							<h:outputText value="Horário de Abertura da Clínica" />
							<p:inputMask value="#{clinicaManager.clinica.horarioAbertura}" mask="99:99" />
							
							<h:outputText value="Horário de Encerramento da Clínica" />
							<p:inputMask value="#{clinicaManager.clinica.horarioFechamento}" mask="99:99"/>
							
							<h:outputText value="Login do Super-Usuário do Sistema" rendered="#{clinicaManager.clinica.id == null}"/>
							<p:inputText value="#{clinicaManager.usuario.login}" rendered="#{clinicaManager.clinica.id == null}"/>
							
							<h:outputText value="Senha do Super-Usuário do Sistema" rendered="#{clinicaManager.clinica.id == null}"/>
							<p:password value="#{clinicaManager.usuario.senha}" rendered="#{clinicaManager.clinica.id == null}"/>
							
							<h:outputText value="Logotipo" />
							<h:panelGroup>
								<p:graphicImage value="#{clinicaManager.content}" id="content"/>
							
								<p:fileUpload fileUploadListener="#{clinicaManager.handleFileUpload}"
									update="content"
									cancelLabel="Cancelar"
									uploadLabel="Enviar"
									label="Selecionar"
									mode="advanced"   
						            sizeLimit="10000"   
						            allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
								
							</h:panelGroup>
						
							
						
						</h:panelGrid>
						
						<p:commandButton value="Salvar" action="#{clinicaManager.update}" rendered="#{clinicaManager.clinica.id != null}" />
					</h:form>
				</p:panel>
			</ui:define>
		</ui:composition>
	</f:view>
</html>